package com.xhs.controller;

import com.mybatisflex.core.paginate.Page;
import com.xhs.dto.request.EnterprisePageParams;
import com.xhs.entity.MeEnterpriseEntity;
import com.xhs.message.ReturnResult;
import com.xhs.service.MeEnterpriseService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @desc:
 * @projectName: mybatis-flex-demo
 * @author: xhs
 * @date: 2024-07-18 018 10:11
 * @version: JDK 1.8
 */
@RestController
@RequestMapping("/enterprise")
public class MeEnterpriseController {

    @Resource
    private MeEnterpriseService enterpriseService;

    /**
     * 分页查询企业信息
     *
     * @param pageParams 查询条件
     * @return ReturnResult<Page < MeEnterpriseEntity>>
     */
    @PostMapping("/page")
    public ReturnResult<Page<MeEnterpriseEntity>> page(@Valid @RequestBody EnterprisePageParams pageParams) {
        return enterpriseService.page(pageParams);
    }
}
